home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1984 July to December / Ahoy_Magazine_84-Jul-Dec_1984_Double_L_unofficial.d64 / salvage diver (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  9KB  |  234 lines

  1. 2 poke53280,7:poke53281,0
  2. 4 print"[147]";spc(7);"***** salvage diver! *****"
  3. 6 print"";spc(13);"a c-64 program"
  4. 7 print"";spc(11);"(c) copyright 1984"
  5. 8 print"";spc(13);"by b.w.behling"
  6. 10 printspc(3);" please wait. reading data......."
  7. 12 forb=0to4:fori=0to62
  8. 14 reada:poke(240+b)*64+i,a
  9. 16 nexti:nextb
  10. 18 dimt$(56),t(56,1):fori=0to56:readw$:readw:t$(i)=w$:t(i,0)=w:t(i,1)=0:nexti
  11. 20 fori=49152to49301:reada:pokei,a:nexti
  12. 22 fori=49408to49575:reada:pokei,a:nexti:restore
  13. 24 fori=0to62:poke246*64+i,0:nexti
  14. 30 ma=15766:pokema,195:pokema+3,102:pokema+6,60:pokema+9,24:pokema+12,60
  15. 32 pokema+15,102:pokema+18,195
  16. 34 fori=0to62step3:forn=2to0step-1
  17. 36 reada:gosub100
  18. 38 poke245*64+(i+n),a2:nextn:nexti
  19. 40 rem***** start *****
  20. 50 wd=0:wl=0:wd$="0.00":wl$="0.00":ba=0:di=3:dd=0:da=2000:da$="2000"
  21. 52 v=53248:m=2040:pokev+21,0:pokev+38,7:pokev+37,10:pokev+28,128:s1=1024
  22. 54 s2=1944:pokev+27,0:pokem+6,246:k=54272:c1=55296:c2=56216
  23. 56 fori=39to44:pokev+i,11:nexti:pokev+45,1:pokev+46,4
  24. 58 fori=0to10step2:pokev+i,0:nexti:pokev+16,0:goto600
  25. 60 rem***** draw screen *****
  26. 61 print"[147]":poke53280,6:fori=0to79:pokes1+i,160:pokec1+i,1:nexti
  27. 62 fori=80to159:pokes1+i,160:pokec1+i,14:nexti
  28. 64 fori=0to80:pokes2+i,160:pokec2+i,12:nexti
  29. 66 print" y";spc(15);"[149][221]"
  30. 68 print" y";spc(12);"y [149][192][219][192]      y";spc(12);"y"
  31. 70 print" y";spc(12);"y  [149][171][152][192][192][192][192][192][192][192][192][192][192][192][149][179]";spc(8);"y"
  32. 72 print" y";spc(12);"y  [149][221]";spc(7);"y   [149][221] y      y"
  33. 74 print" y";spc(12);"y[149][192][192][219][192][192]     y  [149][192][219][192]y      y"
  34. 76 print" y  y";spc(9);"y  [149][221]       [146]y   [149][221] y    y y"
  35. 78 print" y  y";spc(9);"y  [149][221]       [146]y   [149][221] y y  y y"
  36. 80 print" y  y     y   y  [149][221]  [155]^    [146]y[155]^  [149][221] y y  y y"
  37. 82 print" y  y     y  [155]^y  [149][221]y [155]  [163][163][163]  [146]  [149][221] y y  y y"
  38. 84 print" y  y     y [155][209] [209][146]  [149][221]y [155] [209] [209] [209] [146]  [149][221] [178][178][178][178] y y"
  39. 86 print" y yy[155][223] [223][146][149][178][178][178][178][155]   [146][149][178][178][219][178][178][155]       [146][149][178][178][219][178][155]    [146] y y"
  40. 88 print" y yy [155][223]s.s. [163][163][163]     [163][163][163][163][163][163][163] [209]   [209]  [146] y y"
  41. 90 print" y yy  [155][223]marie  [209] [209]    [209] [209]        [146][169][181] y y"
  42. 92 print" y yy   [149][223]                       [146][169]y[149] [146] y y"
  43. 99 return
  44. 100 rem***** shark reverse data *****
  45. 102 ifa=255ora=0thena2=a:return
  46. 104 a2=0:forp=7to0step-1:z=int(a/2^p)
  47. 106 ifz=0thengoto110
  48. 108 a2=a2+2^(7-p):a=a-(z*2^p)
  49. 110 nextp:return
  50. 150 rem** update shark y **
  51. 152 yu=int(rnd(0)*240):ifyu<170then152
  52. 154 pokev+((2*d)+1),yu
  53. 156 return
  54. 200 rem***** update shark x *****
  55. 202 d=int(rnd(1)*6):poke49395,d:poke49396,d*2
  56. 204 poke49393,(int(rnd(0)*5)):poke49394,(5+qq)
  57. 206 poke49397,(2^d):poke49398,(255-2^d)
  58. 208 sys49152:sys49408:gosub350:sys49152
  59. 210 sg=peek(v+30):sg=peek(v+30):ifsg>128andsg<192thengosub430:goto218
  60. 212 ifsg>64andsg<128thenpokev+21,191:gosub402:gosub550
  61. 214 cy=peek(v+16):cy%=2^d:ifcy=cy%andpeek(v+(2*d))>88thengosub150
  62. 216 return
  63. 218 print"";tab(12);" shark got you! [146]":dd=dd+1:pokek+24,0
  64. 220 fori=0to3000:nexti
  65. 222 print"";tab(12);"[154]                [146]":goto450
  66. 300 rem***** diver finished *****
  67. 302 ifba<=0thenreturn
  68. 304 wl=wl+wd:wl$=str$(wl):wd=0:wd$="0.00":ba=0:ba$="0"
  69. 306 print"";tab(33-len(wl$));" net $";wl$
  70. 308 print" treasure # 0           diver has $0.00"
  71. 310 print"";spc(14);" good work!! "
  72. 312 fori=0to3000:nexti
  73. 314 print"";tab(12);"[154]                [146]":goto450
  74. 350 rem***** update timer *****
  75. 352 ifpeek(v+15)<81thengosub300
  76. 354 da=da-(int(rnd(0)*2)+1)
  77. 356 qs=qs+1:ifqs>150thenqs=0:qq=qq+2
  78. 358 ifda<=0thenprint" out of air!! ":dd=dd+1:goto378
  79. 360 da$=str$(da)
  80. 362 ifda<100thenbk=bk+1:ifbk<>2thenbk=1
  81. 364 ifda<100thengosub420:sys49152:onbkgoto370,374
  82. 366 ifda<200then374
  83. 368 ifda<500then372
  84. 370 print" air";da$;" lbs. ":goto376
  85. 372 print"[158] air";da$;" lbs. ":goto376
  86. 374 print" air";da$;" lbs. "
  87. 376 return
  88. 378 fori=0to3000:nexti:pokev+21,63:goto450
  89. 400 rem***** sounds *****
  90. 402 rem** beep **
  91. 404 pokek+1,20:pokek+5,9:pokek+6,248:pokek+24,15:pokek+4,17
  92. 406 foru=1to40:nextu:pokek+4,16:fori=0to24:pokek+i,0:nexti:return
  93. 408 rem** gong **
  94. 410 fori=0to22:pokek+i,0:nexti
  95. 412 pokek+24,143:pokek+5,16:pokek+19,16
  96. 414 pokek+6,252:pokek+20,249:pokek+4,21:pokek+18,17
  97. 416 pokek+1,68:pokek+15,42:fori=1to200:nexti
  98. 418 pokek+4,20:pokek+18,16:fori=1to400:nexti:return
  99. 420 rem** alarm **
  100. 422 fori=0to22:pokek+i,0:nexti
  101. 424 pokek+24,6:pokek+5,80:pokek+6,243:pokek+3,4:pokek+4,65:sys49152
  102. 426 fori=0to100step4:pokek+1,i:nexti:pokek+4,64:fori=1to50:nexti:pokek+4,64
  103. 428 return
  104. 430 rem** shark attack **
  105. 432 fori=0to22:pokek+i,0:nexti
  106. 434 pokek+24,15:pokek+5,80:pokek+6,243:pokek+3,4:pokek+4,129
  107. 436 fori=0to140step4:pokek+1,i:nexti:pokek+4,128:fori=1to50:nexti:pokek+4,128
  108. 438 return
  109. 450 rem***** start diver *****
  110. 452 ba=0:wd=0:wd$="0.00":ifdi<=0then650
  111. 454 da=2000:da$=str$(da):qq=0:qs=0
  112. 456 dy=80:pokev+15,dy:poke(v+16),peek(v+16)and127:pokev+21,255
  113. 458 forxd=0to170:dn=dn+1:ifdn>1thendn=0
  114. 460 pokem+7,243+dn:pokev+14,xd:nextxd:di=di-1
  115. 462 print" air";da$;" lbs. ";tab(15);"divers";di
  116. 464 print"";tab(31-len(wl$));"   net $";wl$
  117. 466 ba$="0":print" treasure # 0 "
  118. 468 print""tab(24-len(wd$));"    diver has $";wd$:goto550
  119. 500 rem***** determine treasure *****
  120. 502 gt=peek(v+30)
  121. 504 ifgt>191thenpoke(v+21),191:ba=ba+1:gosub408:goto508
  122. 506 return
  123. 508 t%=int(rnd(0)*112):ift%>56thent%=0:goto514
  124. 510 ift(t%,1)<>0then508
  125. 512 ift%>11thent(t%,1)=1
  126. 514 ba$=str$(ba):print" treasure #";ba$;" "
  127. 516 print" you found ";t$(t%);"!"
  128. 518 print" value $";t(t%,0):ift(t%,0)=0then522
  129. 520 wd=val(wd$)+t(t%,0):wd$=str$(wd)
  130. 522 forl=0to1500:nextl:fori=0to22:pokek+i,0:nexti
  131. 524 fori=80to159:pokes1+i,160:pokec1+i,14:nexti
  132. 526 print""tab(24-len(wd$));"    diver has $";wd$
  133. 550 rem***** mark treasure *****
  134. 552 poke(v+16),peek(v+16)and191
  135. 554 by=int(rnd(0)*(190-236)+236):pokev+13,by
  136. 556 xm=int(rnd(0)*(24-255)+255):pokev+12,xm:pokem+6,246:pokev+21,255:return
  137. 600 rem***** main program *****
  138. 602 fori=0to5:pokem+i,240:nexti
  139. 604 fori=0to10step2:rs=int(rnd(0)*255):pokev+i,rs:nexti
  140. 606 ford=0to6:gosub150:nextd:gosub60:pokev+21,63
  141. 608 print" air ";da$;" lbs. ";tab(15);"divers";di
  142. 610 print"";tab(31-len(wl$));"   net $";wl$
  143. 612 ba$="0":print" treasure # 0";tab(27-len(wd$));" diver has $";wd$
  144. 614 gosub450
  145. 616 gosub200:gosub500:sys49152
  146. 618 goto616
  147. 650 rem***** game over *****
  148. 652 pokev+21,0:printchr$(147):poke53280,0
  149. 654 printspc(9);"the sea has won again!"
  150. 656 print"";spc(6);"however, you have recovered;"
  151. 658 print"";tab(19-int(len(wl$)/2));"$";wl$
  152. 660 print"";spc(6);"worth of assorted treasure!!"
  153. 662 ifdd=0then670
  154. 664 ifdd=1thenprint"   unfortunately, you lost a diver.":fe=12495:goto668
  155. 666 print"";spc(3);"unfortunately, you lost";dd;"divers.":fe=dd*12495
  156. 668 print"";spc(2);"funeral expenses will cost $";fe;"[157]."
  157. 670 nt$=str$(val(wl$)-fe):ifval(nt$)<=0then676
  158. 672 print"";tab(13);"your profit is"
  159. 674 print"";tab(19-int(len(nt$)/2));"$";nt$:goto682
  160. 676 ifval(nt$)=0thenprint"";spc(8);"you didn't make a dime!!":goto682
  161. 678 print"";tab(14);"your loss is"
  162. 680 print"";tab(19-int(len(nt$)/2));"$";nt$
  163. 682 print"";spc(12);"play again (y/n)?"
  164. 684 getk$:ifk$=""then684
  165. 686 ifk$="y"then 10
  166. 688 end
  167. 700 rem********** data **********
  168. 702 rem***** shark data *****
  169. 704 data0,0,0,0,0,0,0,16,0,0,48,0,0,120,1,0,254,7,127,255,206,223,255,252
  170. 706 data255,255,248,7,255,156,252,2,14,0,1,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  171. 708 data0,0,0,0,0,0,0,0,0,0,0,0
  172. 710 rem***** diver swimming 1 *****
  173. 712 data0,0,128,0,0,0,0,8,0,0,128,0,0,0,0,2,0,0,40,255,0,43,255,8,26,138,33
  174. 714 data10,138,128,8,138,128,96,0,41,0,0,0,0,0,0,0,0,0
  175. 716 data0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  176. 718 rem***** diver swimming 2 *****
  177. 720 data0,32,0,0,136,0,0,0,0,0,128,0,0,0,0,2,0,0
  178. 722 data40,255,0,43,255,0,26,138,41,10,138,128,8,138,128,32,0,32
  179. 724 data64,0,8,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  180. 726 rem***** diver swimming 3 *****
  181. 728 data2,0,0,0,0,0,0,32,0,0,2,0,0,0,0,0,0,128,0,255,40,32,255,232,72,162,164
  182. 730 data2,162,160,2,162,32,104,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  183. 732 data0,0,0,0,0,0,0,0,0,0
  184. 734 rem***** diver swimming 4 *****
  185. 736 data2,0,0,0,0,0,0,32,0,0,2,0,0,0,0,0,0,128,0,255,40,0,255,232,104,162,164
  186. 738 data2,162,160,2,162,32,8,0,8,32,0,1,64,0,0,0,0,0
  187. 740 data0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  188. 742 rem***** treasure data *****
  189. 744 data"a rock",0,"a gold chain",800,"a silver bar!",300,"a gold bar!",1200
  190. 746 data"some gold coins!",1500,"some silver coins!",235
  191. 748 data"some lobsters!",60,"a beer can",0,"an old tire",0
  192. 750 data"a human skeleton!",0,"an old sword",15,"a silver tray!",300
  193. 752 data"a diamond ring!",1300,"a solid gold statue!!",9000
  194. 754 data"a ruby chalice!",2200,"an emerald bracelet!",3200
  195. 756 data"a timex watch.....it ticks!",2,"a box of jewelry!",8765
  196. 758 data"a platinum goblet!",5600,"a '67 chevy engine!",35,"a kitchen sink",6
  197. 760 data"a ww ii dud torpedo!",0,"a pair of shoes in cement!",0
  198. 762 data"a large chest of gems!!",135742,"a phone booth!",0
  199. 764 data"a broken computer",0,"an antique silver cross!",795,"a tool box",18
  200. 766 data"a silver candelabra!",9875,"a case of rare brandy!",3200
  201. 768 data"a barbers chair",65,"a jade throne!!",237865,"a brass bed",150
  202. 770 data"a jeweled crown!!",127335,"a sign 'atlantis 15 km.'!",0
  203. 772 data"a gold scepter!",2400,"a diamond tiara!",56895,"a gold shield!",4300
  204. 774 data"a jeweled dagger",1695,"an outboard motor",95,"an old radiator",0
  205. 776 data"a junked volkswagon",0,"a ww ii fighter plane!",3400,"a steel desk",0
  206. 778 data"a dented coffee pot",0,"a brass compass",135,"a pool table",35
  207. 780 data"some silver candlesticks",450,"an old soda machine",23
  208. 782 data"a cast iron stove",0,"a box of brass locks",85,"an empty coffin!",0
  209. 784 data"a sapphire pendant!",1300,"a rusted suit of armor",75
  210. 786 data"a crystal vase",40,"a crate of doorknobs",65,"a ships wheel",0
  211. 788 rem***** joystick ml data *****
  212. 790 data173,0,220,160,80,162,236,74,176,8,204,15,208,240,3,206
  213. 792 data15,208,74,176,8,236,15,208,240,3,238,15,208,74,176,47
  214. 794 data173,14,208,208,31,173,16,208,41,128,208,16,173,16,208,9
  215. 796 data128,141,16,208,169,80,141,14,208,96,234,234,173,16,208,41
  216. 798 data127,141,16,208,206,14,208,162,241,32,133,192,96,234,234,74
  217. 800 data176,37,162,243,32,133,192,238,14,208,240,30,169,80,205,14
  218. 802 data208,208,20,173,16,208,41,128,240,13,173,16,208,41,127,141
  219. 804 data16,208,169,0,141,14,208,96,234,234,173,16,208,9,128,141
  220. 806 data16,208,96,234,234,236,255,7,208,4,238,255,7,96,142,255
  221. 808 data7,96,234,234,0,0
  222. 810 rem***** shark x ml data *****
  223. 812 data169,0,162,0,160,0,206,242,192,173,241,192,240,72,169,240
  224. 814 data172,243,192,153,248,7,174,244,192,189,0,208,208,42,173,16
  225. 816 data208,45,245,192,208,25,173,16,208,13,245,192,141,16,208,169
  226. 818 data90,174,244,192,157,0,208,173,242,192,208,202,96,0,0,173
  227. 820 data16,208,45,246,192,141,16,208,174,244,192,222,0,208,173,242
  228. 822 data192,208,179,96,0,0,169,245,172,243,192,153,248,7,174,244
  229. 824 data192,254,0,208,240,46,169,90,174,244,192,221,0,208,208,25
  230. 826 data173,16,208,45,245,192,240,17,173,16,208,45,246,192,141,16
  231. 828 data208,169,0,174,244,192,157,0,208,173,242,192,240,3,76,6
  232. 830 data193,96,0,0,173,16,208,13,245,192,141,16,208,173,242,192
  233. 832 data240,3,76,6,193,96,0,0
  234.